﻿using System;
namespace RandomNumber;

class project
{
    static void Main(string[]args)
    {
        int x;
        double sum = 0;
        int[] array = new int[100];
        Random random = new Random();

        for (x = 0; x < array.Length; x++)
        {
            array[x] = random.Next(1000)+1;
             sum += x;
        }
        int[] order = array.OrderByDescending(x => x).ToArray();
        for (x = 0; x < array.Length; x++)
        {
            Console.WriteLine("{0}", order[x]);
        }
        Console.WriteLine("和为:{0}", sum);
        Console.WriteLine("平均值为:{0}", sum/array.Length);
    }
}
